/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: 
 *
 *  Author: Amlogic Software
 *  Created: Fri Nov 11 01:14:48 2005
 *
 *******************************************************************/
/* temp test only */
#define KEY_LEN 2048
static unsigned char enckey[]= {
  0x42,0x63,0x02,0x23,0xd2,0xfb,0xa9,0x5e,0x1d,0x2e,0xf9,0x86,0x45,
  0x1e,0xd9,0x9e,0x1d,0x55,0x94,0xd9,0x08,0x45,0xbc,0xe9,0x48,0x95,
  0xe4,0x39,0x93,0xe8,0x43,0xa4,0x23,0x40,0xe3,0x0c,0xb3,0xd8,0x43,
  0xff,0x7e,0x8f,0x1e,0xa7,0x26,0xbf,0x36,0xbf,0xbe,0x3f,0xb5,0x3a,
  0xa9,0x22,0x9d,0x0a,0xe9,0x7a,0xc5,0x5a,0x39,0x89,0x60,0xc5,0x84,
  0x21,0xc0,0x6d,0x1c,0xb9,0x60,0x15,0xdf,0x6c,0x3f,0xc0,0x87,0x5c,
  0x17,0xd0,0xdf,0x1c,0x5f,0x9b,0xca,0x03,0x7a,0xab,0x8a,0xdb,0x2a,
  0x7b,0x5a,0xa3,0x81,0xe6,0xe5,0x06,0x21,0x4e,0x7d,0x96,0x81,0xb6,
  0xb5,0xcd,0xdc,0xe1,0xe0,0xfd,0xf4,0xf1,0xf0,0xfd,0xfc,0xf1,0xeb,
  0xe0,0xdb,0xcc,0xab,0xb8,0x8b,0x94,0x7b,0x40,0x2b,0x07,0xc6,0xe7,
  0x86,0xaf,0x5e,0x77,0x2e,0xd7,0x96,0xa7,0x7d,0x02,0xc1,0x9a,0x55,
  0x12,0x91,0xd2,0x1d,0x52,0x81,0xc1,0x38,0x6d,0xcc,0x19,0x68,0xb5,
  0x14,0x61,0xc8,0x2d,0xa7,0xc4,0x67,0x88,0x3f,0x54,0xcf,0x78,0xf7,
  0x04,0x97,0x23,0xa2,0x3b,0xb2,0x33,0x32,0xb3,0x32,0xb3,0x22,0xab,
  0x19,0x8e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0x12,0x91,0xd2,0x1d,
  0x52,0x81,0xc1,0x38,0x6d,0xcc,0x19,0x68,0xb5,0x14,0x61,0xc8,0x2d,
  0xa7,0xc4,0x67,0x88,0x3f,0x54,0xcf,0x78,0xf7,0x04,0x97,0x23,0xa2,
  0x3b,0xb2,0x33,0x32,0xb3,0x32,0xb3,0x22,0xab,0x19,0x8e,0x6d,0xfe,
  0x49,0xd6,0xb5,0x0e,0xe9,0x4e,0x0d,0xa5,0x44,0xe9,0x98,0x35,0xec,
  0x99,0x58,0xe5,0xb4,0x49,0x03,0xd8,0x93,0x54,0x53,0x90,0xd3,0x1c,
  0x43,0x88,0xf3,0x2f,0x0e,0x5f,0xae,0xf7,0xd6,0x2f,0x06,0x6f,0x6e,
  0x8f,0xa5,0xca,0xf9,0x12,0x0d,0x3a,0x39,0x4a,0x55,0x6a,0x69,0x79,
  0x70,0x75,0x77,0x74,0x77,0x78,0x6f,0x64,0x5f,0x48,0x27,0x34,0x07,
  0x13,0xf2,0xcb,0xa2,0x83,0x42,0x63,0x02,0x23,0xd2,0xfb,0xa9,0x5e,
  0x1d,0x2e,0xf9,0x86,0x45,0x1e,0xd9,0x9e,0x1d,0x55,0x94,0xd9,0x08,
  0x45,0xbc,0xe9,0x48,0x95,0xe4,0x39,0x93,0xe8,0x43,0xa4,0x23,0x40,
  0xe3,0x0c,0xb3,0xd8,0x43,0xff,0x7e,0x8f,0x1e,0xa7,0x26,0xbf,0x36,
  0xbf,0xbe,0x3f,0xb5,0x3a,0xa9,0x22,0x9d,0x0a,0xe9,0x7a,0xc5,0x5a,
  0x39,0x89,0x60,0xc5,0x84,0x21,0xc0,0x6d,0x1c,0xb9,0x60,0x15,0xdf,
  0x6c,0x3f,0xc0,0x87,0x5c,0x17,0xd0,0xdf,0x1c,0x5f,0x9b,0xca,0x03,
  0x7a,0xab,0x8a,0xdb,0x2a,0x7b,0x5a,0xa3,0x81,0xe6,0xe5,0x06,0x21,
  0x4e,0x7d,0x96,0x81,0xb6,0xb5,0xcd,0xdc,0xe1,0xe0,0xfd,0xf4,0xf1,
  0xf0,0xfd,0xfc,0xf1,0xeb,0xe0,0xdb,0xcc,0xab,0xb8,0x8b,0x94,0x7b,
  0x40,0x2b,0x07,0xc6,0xe7,0x86,0xaf,0x5e,0x77,0x2e,0xd7,0x96,0xa7,
  0x7d,0x02,0xc1,0x9a,0x55,0x12,0x91,0xd2,0x1d,0x52,0x81,0xc1,0x38,
  0x6d,0xcc,0x19,0x68,0xb5,0x14,0x61,0xc8,0x2d,0xa7,0xc4,0x67,0x88,
  0x3f,0x54,0xcf,0x78,0xf7,0x04,0x97,0x23,0xa2,0x3b,0xb2,0x33,0x32,
  0xb3,0x32,0xb3,0x22,0xab,0x19,0x8e,0x6d,0xfe,0x49,0xd6,0xb5,0x0e,
  0xe9,0x4e,0x0d,0xa5,0x44,0xe9,0x98,0x35,0xec,0x99,0x58,0xe5,0xb4,
  0x49,0x03,0xd8,0x93,0x54,0x53,0x90,0xd3,0x1c,0x43,0x88,0xf3,0x2f,
  0x0e,0x5f,0xae,0xf7,0xd6,0x2f,0x06,0x6f,0x6e,0x8f,0xa5,0xca,0xf9,
  0x12,0x0d,0x3a,0x39,0x4a,0x55,0x6a,0x69,0x79,0x70,0x75,0x77,0x74,
  0x77,0x78,0x6f,0x64,0x5f,0x48,0x27,0x34,0x07,0x13,0xf2,0xcb,0xa2,
  0x83,0x42,0x63,0x02,0x23,0xd2,0xfb,0xa9,0x5e,0x1d,0x2e,0xf9,0x86,
  0x45,0x1e,0xd9,0x9e,0x1d,0x55,0x94,0xd9,0x08,0x45,0xbc,0xe9,0x48,
  0x95,0xe4,0x39,0x93,0xe8,0x43,0xa4,0x23,0x40,0xe3,0x0c,0xb3,0xd8,
  0x43,0xff,0x7e,0x8f,0x1e,0xa7,0x26,0xbf,0x36,0xbf,0xbe,0x3f,0xb5,
  0x3a,0xa9,0x22,0x9d,0x0a,0xe9,0x7a,0xc5,0x5a,0x39,0x89,0x60,0xc5,
  0x84,0x21,0xc0,0x6d,0x1c,0xb9,0x60,0x15,0xdf,0x6c,0x3f,0xc0,0x87,
  0x5c,0x17,0xd0,0xdf,0x1c,0x5f,0x9b,0xca,0x03,0x7a,0xab,0x8a,0xdb,
  0x2a,0x7b,0x5a,0xa3,0x81,0xe6,0xe5,0x06,0x21,0x4e,0x7d,0x96,0x81,
  0xb6,0xb5,0xcd,0xdc,0xe1,0xe0,0xfd,0xf4,0xf1,0xf0,0xfd,0xfc,0xf1,
  0xeb,0xe0,0xdb,0xcc,0xab,0xb8,0x8b,0x94,0x7b,0x40,0x2b,0x07,0xc6,
  0xe7,0x86,0xaf,0x5e,0x77,0x2e,0xd7,0x96,0xa7,0x7d,0x02,0xc1,0x9a,
  0x55,0x12,0x91,0xd2,0x1d,0x52,0x81,0xc1,0x38,0x6d,0xcc,0x19,0x68,
  0xb5,0x14,0x61,0xc8,0x2d,0xa7,0xc4,0x67,0x88,0x3f,0x54,0xcf,0x78,
  0xf7,0x04,0x97,0x23,0xa2,0x3b,0xb2,0x33,0x32,0xb3,0x32,0xb3,0x22,
  0xab,0x19,0x8e,0x6d,0xfe,0x49,0xd6,0xb5,0x0e,0xe9,0x4e,0x0d,0xa5,
  0x44,0xe9,0x98,0x35,0xec,0x99,0x58,0xe5,0xb4,0x49,0x03,0xd8,0x93,
  0x54,0x53,0x90,0xd3,0x1c,0x43,0x88,0xf3,0x2f,0x0e,0x5f,0xae,0xf7,
  0xd6,0x2f,0x06,0x6f,0x6e,0x8f,0xa5,0xca,0xf9,0x12,0x0d,0x3a,0x39,
  0x4a,0x55,0x6a,0x69,0x79,0x70,0x75,0x77,0x74,0x77,0x78,0x6f,0x64,
  0x5f,0x48,0x27,0x34,0x07,0x13,0xf2,0xcb,0xa2,0x83,0x42,0x63,0x02,
  0x23,0xd2,0xfb,0xa9,0x5e,0x1d,0x2e,0xf9,0x86,0x45,0x1e,0xd9,0x9e,
  0x1d,0x55,0x94,0xd9,0x08,0x45,0xbc,0xe9,0x48,0x95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77,0x74,0x77,0x78,0x6f,0x64,0x5f,0x48,0x27,0x34,
  0x07,0x13,0xf2,0xcb,0xa2,0x83,0x42,0x63,0x02,0x23,0xd2,0xfb,0xa9,
  0x5e,0x1d,0x2e,0xf9,0x86,0x45,0x1e,0xd9,0x9e,0x1d,0x55,0x94,0xd9,
  0x08,0x45,0xbc,0xe9,0x48,0x95,0xe4,0x39,0x93,0xe8,0x43,0xa4,0x23,
  0x40,0xe3,0x0c,0xb3,0xd8,0x43,0xff,0x7e,0x8f,0x1e,0xa7,0x26,0xbf,
  0x36,0xbf,0xbe,0x3f,0xb5,0x3a,0xa9,0x22,0x9d,0x0a,0xe9,0x7a,0xc5,
  0x5a,0x39,0x89,0x60,0xc5,0x84,0x21,0xc0,0x6d,0x1c,0xb9,0x60,0x15,
  0xdf,0x6c,0x3f,0xc0,0x87,0x5c,0x17,0xd0,0xdf,0x1c,0x5f,0x9b,0xca,
  0x03,0x7a,0xab,0x8a,0xdb,0x2a,0x7b,0x5a,0xa3,0x81,0xe6,0xe5,0x06,
  0x21,0x4e,0x7d,0x96,0x81,0xb6,0xb5,0xcd,0xdc,0xe1,0xe0,0xfd,0xf4,
  0xf1,0xf0,0xfd,0xfc,0xf1,0xeb,0xe0,0xdb,0xcc,0xab,0xb8,0x8b,0x94,
  0x7b,0x40,0x2b,0x07,0xc6,0xe7,0x86,0xaf,0x5e,0x77,0x2e,0xd7,0x96,
  0xa7,0x7d,0x02,0xc1,0x9a,0x55,0x12,0x91,0xd2,0x1d,0x52,0x81,0xc1,
  0x38,0x6d,0xcc,0x19,0x68,0xb5,0x14,0x61,0xc8,0x2d,0xa7,0xc4,0x67,
  0x88,0x3f,0x54,0xcf,0x78,0xf7,0x04,0x97,0x23,0xa2,0x3b,0xb2,0x33,
  0x32,0xb3,0x32,0xb3,0x22,0xab,0x19,0x8e,0x6d,0xfe,0x49,0xd6,0xb5,
  0x0e,0xe9,0x4e,0x0d,0xa5,0x44,0xe9,0x98,0x35,0xec,0x99,0x58,0xe5,
  0xb4,0x49,0x03,0xd8,0x93,0x54,0x53,0x90,0xd3,0x1c,0x43,0x88,0xf3,
  0x2f,0x0e,0x5f,0xae,0xf7,0xd6,0x2f,0x06,0x6f,0x6e,0x8f,0xa5,0xca,
  0xf9,0x12,0x0d,0x3a,0x39,0x4a,0x55,0x6a,0x69,0x79,0x70,0x75,0x77,
  0x74,0x77,0x78,0x6f,0x64,0x5f,0x48,0x27,0x34,0x07,0x13,0xf2,0xcb,
  0xa2,0x83,0x42,0x63,0x02,0x23,0xd2,0xfb,0xa9,0x5e,0x1d,0x2e,0xf9,
  0x86,0x45,0x1e,0xd9,0x9e,0x1d,0x55,0x94,0xd9,0x08,0x45,0xbc,0xe9,
  0x48,0x95,0xe4,0x39,0x93,0xe8,0x43,0xa4,0x23,0x40,0xe3,0x0c,0xb3,
  0xd8,0x43,0xff,0x7e,0x8f,0x1e,0xa7,0x26,0xbf,0x36,0xbf,0xbe,0x3f,
  0xb5,0x3a,0xa9,0x22,0x9d,0x0a,0xe9,0x7a,0xc5,0x5a,0x39,0x89,0x60,
  0xc5,0x84,0x21,0xc0,0x6d,0x1c,0xb9,0x60,0x15,0xdf,0x6c,0x3f,0xc0,
  0x87,0x5c,0x17,0xd0,0xdf,0x1c,0x5f,0x9b,0xca,0x03,0x7a,0xab,0x8a,
  0xdb,0x2a,0x7b,0x5a,0xa3,0x81,0xe6,0xe5,0x06,0x21,0x4e,0x7d,0x96,
  0x81,0xb6,0xb5,0xcd,0xdc,0xe1,0xe0,0xfd,0xf4,0xf1,0xf0,0xfd,0xfc,
  0xf1,0xeb,0xe0,0xdb,0xcc,0xab,0xb8,0x8b,0x94,0x7b,0x40,0x2b,0x07,
  0xc6,0xe7,0x86,0xaf,0x5e,0x77,0x2e,0xd7,0x96,0xa7,0x7d,0x02,0xc1,
  0x9a,0x55,0x12,0x91,0xd2,0x1d,0x52,0x81,0xc1,0x38,0x6d,0xcc,0x19,
  0x68,0xb5,0x14,0x61,0xc8,0x2d,0xa7,0xc4,0x67,0x88,0x3f,0x54,0xcf,
  0x78,0xf7,0x04,0x97,0x23,0xa2,0x3b,0xb2,0x33,0x32,0xb3,0x32,0xb3,
  0x22,0xab,0x19,0x8e,0x6d,0xfe,0x49,0xd6,0xb5,0x0e,0xe9,0x4e,0x0d,
  0xa5,0x44,0xe9,0x98,0x35,0xec,0x99,0x58,0xe5,0xb4,0x49,0x03,0xd8,
  0x93,0x54,0x53,0x90,0xd3,0x1c,0x43,0x88,0xf3,0x2f,0x0e,0x5f,0xae,
  0xf7,0xd6,0x2f,0x06,0x6f,0x6e,0x8f,0xa5,0xca,0xf9,0x12,0x0d,0x3a,
  0x39,0x4a,0x55,0x6a,0x69,0x79,0x70,0x75,0x77,0x74,0x77,0x78,0x6f,
  0x64,0x5f,0x48,0x27,0x34,0x07,0x13,0xf2,0xcb,0xa2,0x83,0x42,0x63,
  0x02,0x23,0xd2,0xfb,0xa9,0x5e,0x1d,0x2e,0xf9,0x86,0x45,0x1e,0xd9,
  0x9e,0x1d,0x55,0x94,0xd9,0x08,0x45,0xbc,0xe9,0x48,0x95,0xe4,0x39,
  0x93,0xe8,0x43,0xa4,0x23,0x40,0xe3,0x0c,0xb3,0xd8,0x43,0xff,0x7e,
  0x8f,0x1e,0xa7,0x26,0xbf,0x36,0xbf,0xbe,0x3f,0xb5,0x3a,0xa9,0x22,
  0x9d,0x0a,0xe9,0x7a,0xc5,0x5a,0x39,0x89,0x60,0xc5,0x84,0x21,0xc0,
  0x6d,0x1c,0xb9,0x60,0x15,0xdf,0x6c,0x3f,0xc0,0x87,0x5c,0x17,0xd0,
  0xdf,0x1c,0x5f,0x9b,0xca,0x03,0x7a,0xab,0x8a,0xdb,0x2a,0x7b,0x5a,
  0xa3,0x81,0xe6,0xe5,0x06,0x21,0x4e,0x7d,0x96,0x81,0xb6,0xb5,0xcd,
  0xdc,0xe1,0xe0,0xfd,0xf4,0xf1,0xf0,0xfd,0xfc,0xf1,0xeb,0xe0,0xdb,
  0xcc,0xab,0xb8,0x8b,0x94,0x7b,0x40,0x2b,0x07,0xc6,0xe7,0x86,0xaf,
  0x5e,0x77,0x2e,0xd7,0x96,0xa7,0x7d,0x02,0xc1,0x9a,0x55,0x12,0x91,
  0xd2,0x1d,0x52,0x81,0xc1,0x38,0x6d,0xcc,0x19,0x68,0xb5,0x14,0x61,
  0xc8,0x2d,0xa7,0xc4,0x67,0x88,0x3f,0x54,0xcf,0x78,0xf7,0x04,0x97,
  0x23,0xa2,0x3b,0xb2,0x33,0x32,0xb3,0x32,0xb3,0x22,0xab,0x19,0x8e,
  0x6d,0xfe,0x49,0xd6,0xb5,0x0e,0xe9,0x4e,0x0d,0xa5,0x44,0xe9,0x98,
  0x35,0xec,0x99,0x58,0xe5,0xb4,0x49,0x03,0xd8,0x93,0x54,0x53,0x90,
  0xd3,0x1c,0x43,0x88,0xf3,0x2f,0x0e,0x5f,0xae,0xf7,0xd6,0x2f,0x06,
  0x6f,0x6e,0x8f,0xa5,0xca,0xf9,0x12,0x0d,0x3a,0x39,0x4a,0x55,0x6a,
  0x69,0x79,0x70,0x75,0x77,0x74,0x77,0x78,0x6f,0x64,0x5f,0x48,0x27,
  0x34,0x07,0x13,0xf2,0xcb,0xa2,0x83,0x83
};
